package com.jcode.skeleton.exception;

import com.jcode.skeleton.model.ResponsePacket;

/**
 * 业务运行时异常
 *
 * @Author dreajay
 * @DateTime 2017年3月11日 下午1:56:04
 *
 */
public class BizException extends RuntimeException {

	private static final long serialVersionUID = -7673405260130214843L;

	private ResponsePacket packet;

	public BizException(ResponsePacket packet) {
		super(packet.getErrMsg());
		this.packet = packet;
	}

	public BizException(ResponsePacket packet, Throwable cause) {
		super(packet.getErrMsg(), cause);
		this.packet = packet;
	}

	public ResponsePacket getPacket() {
		return packet;
	}
	
	public String getErrCode() {
		return packet.getErrCode();
	}

}
